package com.xinqi.modules.exam.analyze.controller.inner;

import com.xinqi.common.base.response.PageInfo;
import com.xinqi.common.base.response.R;
import com.xinqi.modules.exam.analyze.client.CourseExamPaperAnalyzeClient;
import com.xinqi.modules.exam.analyze.dto.req.CourseExamPaperAnalyzeQueryDTO;
import com.xinqi.modules.exam.analyze.dto.rsp.CourseExamPaperAnalyzeResultDTO;
import com.xinqi.modules.exam.analyze.service.CourseExamPaperAnalyzeService;
import io.swagger.v3.oas.annotations.Hidden;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Primary;
import org.springframework.web.bind.annotation.RestController;


/**
 * 课程测评分析内部控制层
 *
 * @author: linkai
 * @date: 2023/07/02
 */
@Hidden
@Primary
@RestController
@RequiredArgsConstructor
public class CourseExamPaperAnalyzeInnerController implements CourseExamPaperAnalyzeClient {
    private final CourseExamPaperAnalyzeService courseExamPaperAnalyzeService;

    @Override
    public R<PageInfo<CourseExamPaperAnalyzeResultDTO>> page(CourseExamPaperAnalyzeQueryDTO dto) {
        PageInfo<CourseExamPaperAnalyzeResultDTO> page = courseExamPaperAnalyzeService.page(dto, dto);
        return R.data(page);
    }

    @Override
    public R<CourseExamPaperAnalyzeResultDTO> findById(Long id) {
        CourseExamPaperAnalyzeResultDTO dto = courseExamPaperAnalyzeService.findById(id);
        return R.data(dto);
    }
}
